package com.zyb.springcloud.dao;

import com.zyb.springcloud.entities.Payment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * Mapper与Reponsitory的区别
 * Repository需要在Spring中配置扫描地址，然后生成Dao层的Bean才能被注入到Service层中，需要使用@MapperScan在启动类上配置扫描地址。
 * Mapper不需要配置扫描地址，通过xml里面的namespace里面的接口地址，生成了Bean后注入到Service层中。相当于@Reponsitory加@MapperScan注解
 *
 */
@Mapper
public interface PaymentDao {

    public int create(Payment payment);

    public Payment getPaymentById(@Param("id") Long id);
}
